package com.digital.smartgrow.controller.datacenter;

import com.digital.smartgrow.common.advice.Result;
import com.digital.smartgrow.dto.datacenter.ProfessionalTitlePageDTO;
import com.digital.smartgrow.service.datacenter.ProfessionalTitleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 职称信息 前端控制器
 * </p>
 *
 * @author xiewb
 * @since 2022-04-10
 */
@Api(tags = "职称信息")
@RestController
@RequestMapping("${context.prefix}/professionalTitle")
public class ProfessionalTitleController {

    @Autowired
    private ProfessionalTitleService professionalTitleService;

    @ApiOperation(value = "列表分页查询")
    @PostMapping("/getListByPage")
    public Object getListByPage(@RequestBody ProfessionalTitlePageDTO professionalTitlePageDTO){
        return professionalTitleService.getListByPage(professionalTitlePageDTO);
    }

    @ApiOperation(value = "职称信息详情")
    @GetMapping("/getInfo")
    public Object getInfo(Integer id){
        if (id == null) return Result.fail("id不能为空");
        return professionalTitleService.getInfo(id);
    }
}
